from rest_framework import serializers

from apps.contents.models import GoodsChannel, GoodsCategory


class GoodsChannelSerializer(serializers.ModelSerializer):
    """
    商品频道序列化器
    """
    group = serializers.StringRelatedField(read_only=True)
    group_id = serializers.IntegerField()

    category = serializers.StringRelatedField(read_only=True)
    category_id = serializers.IntegerField()

    class Meta:
        model = GoodsChannel
        fields = "__all__"